# 用python3实现如下功能：
# 有两个dbf文件1.dbf，2.dbf，将2.dbf文件中的数据插入到1.dbf中，重复数据无需插入


from dbfread import DBF


dbf_a = DBF(r'D:\\vx\WeChat Files\\mlxt941207\\FileStorage\\File\\2020-06\\demo\\SCD_98_601_20200327_DJ.DBF',encoding='GBK')
dbf_b = DBF(r'D:\\vx\WeChat Files\\mlxt941207\\FileStorage\\File\\2020-06\\demo\\SCD_98_601_20200327_DJ_add.DBF')

list_a = list(dbf_a)
list_b = list(dbf_b)

for readDB in list_a:
    if readDB not in list_b:
        list_b.append(readDB)
    else:
        continue
a = open('.\\result.txt',mode='w',encoding='utf8')
for value_b in list_b:
    a.writelines(str(value_b))
a.close()






# dbf_a = [1,3,6,4,8,3]

# dbf_b = [1,3,6,4,2,9,7]

# for i in dbf_a:
#     if i not in dbf_b:
#         dbf_b.append(i)
#     else:
#         continue
# print(dbf_b)
